/*     */ package com.lmpop.trade.ti_voucher;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ 
/*     */ public class Ti_batchmadevoucherInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_batchmadevoucherInfo()
/*     */   {
/*  20 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  29 */     Ti_batchmadevoucher ti_batchmadevoucher = new Ti_batchmadevoucher();
/*  30 */     ti_batchmadevoucher.setTrade_id(map.getString("trade_id"));
/*  31 */     ti_batchmadevoucher.setVoucher_type(map.getString("voucher_type"));
/*  32 */     ti_batchmadevoucher.setVoucher_name(map.getString("voucher_name"));
/*  33 */     ti_batchmadevoucher.setUsage_rules(map.getInt("usage_rules"));
/*  34 */     ti_batchmadevoucher.setStart_time(map.getString("start_time"));
/*  35 */     ti_batchmadevoucher.setEnd_time(map.getString("end_time"));
/*  36 */     ti_batchmadevoucher.setNumber(map.getString("number"));
/*  37 */     ti_batchmadevoucher.setMoney(map.getString("money"));
/*  38 */     ti_batchmadevoucher.setProperty_type(map.getString("property_type"));
/*  39 */     ti_batchmadevoucher.setUser_id(map.getString("user_id"));
/*     */ 
/*  42 */     String result_code = "0";
/*     */     try {
/*  44 */       insert(dbmMgr, ti_batchmadevoucher);
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/*  55 */       e.printStackTrace();
/*  56 */       result_code = "1";
/*     */     }
/*  58 */     map.setString("result_code", result_code);
/*  59 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_batchmadevoucher ti_batchmadevoucher)
/*     */     throws ApplicationException
/*     */   {
/*  68 */     dbmMgr.update("insertTi_batchmadevoucher", ti_batchmadevoucher);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  78 */     String pkid_string = map.getString("pkid");
/*  79 */     String result_code = "0";
/*     */     try {
/*  81 */       if (!pkid_string.equals("")) {
/*  82 */         String[] pkStr = pkid_string.split("\\|");
/*  83 */         for (int i = 0; i < pkStr.length; i++) {
/*  84 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  88 */       e.printStackTrace();
/*  89 */       result_code = "1";
/*     */     }
/*  91 */     map.setString("result_code", result_code);
/*  92 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 101 */     dbmMgr.update("deleteTi_batchmadevoucher", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 110 */     Ti_batchmadevoucher ti_batchmadevoucher = new Ti_batchmadevoucher();
/* 111 */     ti_batchmadevoucher.setTrade_id(map.getString("trade_id"));
/* 112 */     ti_batchmadevoucher.setVoucher_type(map.getString("voucher_type"));
/* 113 */     ti_batchmadevoucher.setVoucher_name(map.getString("voucher_name"));
/* 114 */     ti_batchmadevoucher.setUsage_rules(map.getInt("usage_rules"));
/* 115 */     ti_batchmadevoucher.setStart_time(map.getString("start_time"));
/* 116 */     ti_batchmadevoucher.setEnd_time(map.getString("end_time"));
/* 117 */     ti_batchmadevoucher.setNumber(map.getString("number"));
/* 118 */     ti_batchmadevoucher.setMoney(map.getString("money"));
/* 119 */     ti_batchmadevoucher.setProperty_type(map.getString("property_type"));
/* 120 */     ti_batchmadevoucher.setRsrv_str1(map.getString("rsrv_str1"));
/* 121 */     ti_batchmadevoucher.setRsrv_str2(map.getString("rsrv_str2"));
/* 122 */     ti_batchmadevoucher.setRsrv_str3(map.getString("rsrv_str3"));
/* 123 */     ti_batchmadevoucher.setIn_date(map.getString("in_date"));
/* 124 */     ti_batchmadevoucher.setUser_id(map.getString("user_id"));
/*     */ 
/* 126 */     String result_code = "0";
/*     */     try {
/* 128 */       update(dbmMgr, ti_batchmadevoucher);
/*     */     } catch (ApplicationException e) {
/* 130 */       e.printStackTrace();
/* 131 */       result_code = "1";
/*     */     }
/* 133 */     map.setString("result_code", result_code);
/* 134 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_batchmadevoucher ti_batchmadevoucher)
/*     */     throws ApplicationException
/*     */   {
/* 143 */     dbmMgr.update("updateTi_batchmadevoucher", ti_batchmadevoucher);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 153 */     Hashtable ti_batchmadevoucher = (Hashtable)obj;
/* 154 */     if (start == 0)
/* 155 */       start = 0;
/*     */     else {
/* 157 */       start = (start - 1) * limit;
/*     */     }
/* 159 */     ti_batchmadevoucher.put("start", Integer.valueOf(start));
/* 160 */     ti_batchmadevoucher.put("limit", Integer.valueOf(limit));
/* 161 */     return this.queryList.getList("getListByTi_batchmadevoucherPage", ti_batchmadevoucher);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 172 */     Hashtable ti_batchmadevoucher = (Hashtable)obj;
/* 173 */     List list = this.queryList.getList("getCountByObjTi_batchmadevoucher", ti_batchmadevoucher);
/* 174 */     int count = 0;
/* 175 */     if ((list != null) && (list.size() > 0)) {
/* 176 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 177 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 178 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 181 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 191 */     return this.queryList.getList("getTi_batchmadevoucherByPk", pk);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_voucher.Ti_batchmadevoucherInfo
 * JD-Core Version:    0.6.0
 */